home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3679 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.7 KB  |  42 lines

  1. Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.lang.eiffel
  2. Path: munta.cs.mu.OZ.AU!fjh
  3. From: fjh@munta.cs.mu.OZ.AU (Fergus Henderson)
  4. Subject: Re: type checking in C++ was Re: Hungarian notation
  5. Message-ID: <9602601.20727@mulga.cs.mu.OZ.AU>
  6. Sender: news@cs.mu.OZ.AU (CS-Usenet)
  7. Organization: Computer Science, University of Melbourne, Australia
  8. References: <4cf8hf$8fe@hopi.gate.net> <DKoBrn.CHs@falcon.daytonoh.attgis.com> <4d1j37$ge8@stc06.ctd.ornl.gov> <9601221.15716@mulga.cs.mu.OZ.AU> <4djlme$kf3@gaia.ns.utk.edu>
  9. Date: Thu, 25 Jan 1996 14:39:02 GMT
  10.  
  11. mbk@I_should_put_my_domain_in_etc_NNTP_INEWS_DOMAIN (Matthew B. Kennel) writes:
  12.  
  13. >Fergus Henderson (fjh@munta.cs.mu.OZ.AU) wrote:
  14. >: mbk@jt3ws1.etd.ornl.gov (Kennel) writes:
  15. >
  16. >: >//    delete p;
  17. >: >//    delete [] p; 
  18. >
  19. >: Yes, that is still a problem.  However, it is less of a problem than
  20. >: it used to be, because there is now a standard `vector<T>' class
  21. >: which can be used instead of C's builtin arrays.
  22. >
  23. >That's good to hear.  Is this widely implemented? 
  24.  
  25. A free implementation has been available for a while now; there are
  26. also a couple of different commercial implementations from third-party
  27. library vendors.  Compilers that come with vector<T> already in their
  28. standard library have just started appearing recently.
  29.  
  30. >Is it as efficient as built-in arrays?
  31.  
  32. Nearly.  One difference is that elements are always allocated on the heap,
  33. not the stack, even if the array size is known at compile time.
  34.  
  35. >Can it handle value types as T as well as pointers? 
  36.  
  37. Yes.
  38.  
  39. --
  40. Fergus Henderson                 WWW: http://www.cs.mu.oz.au/~fjh
  41. fjh@cs.mu.oz.au                  PGP: finger fjh@128.250.37.3
  42.